/*
2021-11-9
https://leetcode-cn.com/problems/count-vowel-substrings-of-a-string/
*/
class Solution {
public:
    int countVowelSubstrings(string word) {
        unordered_set<char>s{'a','e','i','o','u'};
        int res=0,n=word.size();
        for(int i=0;i<=n-5;i++)
        {
            if(!s.count(word[i])) continue;
            int j=i;
            unordered_set<char>cnt;
            while(j<n && s.count(word[j]))
            {
                cnt.insert(word[j++]);
                if(cnt.size()==5)
                    res++;
            }
        }
        return res;
    }
};
